package com.wiscamp.ninechapters.panels.infrastructure.converters;


import com.wiscamp.ninechapters.panels.domain.entities.Application;
import com.wiscamp.ninechapters.panels.infrastructure.po.ApplicationPO;
import com.wiscamp.ninechapters.panels.infrastructure.views.ApplicationView;
import org.mapstruct.*;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE,
        unmappedSourcePolicy = ReportingPolicy.IGNORE,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
        nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface ApplicationConverter {
    ApplicationConverter Instance = Mappers.getMapper(ApplicationConverter.class);

    Application toApplication(ApplicationPO po);

    Application toApplicationByView(ApplicationView view);

    ApplicationPO toApplicationPO(Application entity);

    ApplicationPO toApplicationPO(Application entity, @MappingTarget ApplicationPO po);

}
